<extend name="Public/common"/>
<block name="othercss"> 

</block>
<block name="body">

<div class="mian">
    <div class="pro">
        <div class="box">
            <div class="loc clearfix">
                <div class="sl">共 {$total_count} 件相关商品</div>
                <i class="icon iconloc"></i>您现在在这里：<a href="{:urlrotue('/')}">百宝库</a> > {:$search_select?$search_select:'所有商品'}
            </div>
            <dl class="pro-header">
            <if condition="count($brand_list) gt 0">
                <dd class="clearfix">
                    <div class="t1">品牌</div>
                    <div class="t2 brands">
                        <ul class="b-list clearfix">
                        <foreach name="brand_list" item="brand_item">
                            <li>
                                <a  href="{$brand_item.url}" id="brand_{$brand_item.brand_id}">
                                    <img src="__ROOT__{$brand_item.logo}" width="115" height="55"/>
                                    <div class="name">{$brand_item.brand_name}</div>
                                </a>
                            </li>
                            </foreach>
                        </ul>
                        <a class="more">更多</a>
                    </div>
                </dd>
               </if>
                 <if condition="count($cat_list) gt 0"> 
                <dd class="clearfix">
                    <div class="t1">分类</div>
                    <div class="t2">
                        <div class="series-list clearfix">
                        
                        <foreach name="cat_list" item="cat_item">
                            <a href="{$cat_item.url}" id="cat_{$cat_item.cat_id}">{$cat_item.cat_name}</a> <if condition="count($cat_list) gt $key+1"> | </if>
                        </foreach>
           
                        </div>
                    </div>
                </dd>
                </if>
                <if condition="count($price_list) gt 1">
                <dd class="clearfix">
                    <div class="t1">价格</div>
                    <div class="t2">
                        <div class="price-list clearfix">
                           <foreach name="price_list" item="price_item">
                            <a href="{$price_item.url}" id="price_{$price_item.text}">{$price_item.text}</a>  <if condition="count($price_list) gt $key"> | </if> 
                        </foreach>
                        </div>
                    </div>
                </dd>
                </if>
            </dl>
            <div class="select-list clearfix">
                <div class="right"><span class="number">{$p}/{$page_count}</span> 
                      <if condition="!empty($page_prev_url)">
                            <a href="{$page_prev_url}" class='prev'><i></i></a>
                        </if>
                        <if condition="!empty($page_next_url)">
                            <a href="{$page_next_url}" class="next"><i></i></a>
                        </if>
              
                </div>
                <div class="left clearfix">
                
                <if condition="empty($curr_order)">
                   <a href="{$order_list['0']['url']}"  class="in">综合<i class=" icon icontop on"></i></a>
                 <else />
                 <a href="{$order_list['0']['url']}"  class="in">综合</a>
                 </if>
                 
                   <if condition="$curr_order eq 'time_asc'">
                   <a href="{$order_list['0']['url']}">新品<i class=" icon icon7 on"></i><i class="icon icon7"></i></a>
                 <elseif condition="$curr_order eq 'time_desc'" />
                    <a href="{$order_list['7']['url']}">新品<i class=" icon icon7"></i><i class="icon icon7 on"></i></a>
                 <else />
                   <a href="{$order_list['6']['url']}">新品<i class=" icon icontop"></i></a>
                 </if>
                  
                 
               <if condition="$curr_order eq 'price_asc'">
                <a href="{$order_list['2']['url']}">价格<i class=" icon icon7 on"></i><i class="icon icon7"></i></a>
                 <elseif condition="$curr_order eq 'price_desc'" />
                <a href="{$order_list['0']['url']}">价格<i class=" icon icon7"></i><i class="icon icon7 on"></i></a>
                 <else />
                 <a href="{$order_list['3']['url']}">价格<i class=" icon icon7"></i><i class="icon icon7"></i></a>
                  </if>
             
                    <a href="{$order_list['5']['url']}">热度<i class=" icon icontop"></i></a>
                    <div class="text"><input type="text" id="priceMin" title="最低价" maxlength="6" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');"  value="{$price_s[0]}" class="input1"/></div>
                    <div class="and">-</div>
                    <div class="text"><input type="text"  id="priceMax" title="最高价" maxlength="8" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" value="{$price_s[1]}" class="input1"/> <input type="button" class="price_sub" value="确定" /></div>
                </div>
            </div>
        </div>
        <!--pro-lists-->
        <div class="pro-lists">
            <ul class="clearfix">
            <empty name="glist"><div style="margin-top:50px; text-align:center">暂无记录</div></empty>
             <foreach name="glist" item="gitem">
                <li>
                    <a class="each-item" href="{:U('Goods/index',array('id'=>$gitem['goods_id']))}">
                        <div class="imgs picture">
                            <img src="__ROOT__{$gitem.picture}" alt="{$gitem.goods_name}" width="220" height="220"/>
                        </div>
                        <div class="price clearfix">
                            <div class="t1">￥ {$gitem.price}</div>
                            <div class="t2">￥ <span class="big"> {$gitem.price}</span></div>
                        </div>
                        <div class="twos">{$gitem.goods_name}</div>
                    </a>
                    <a class="lans">
                        <span>{$gitem.count_comment}</span>条评价
                    </a>
                </li>
              </foreach>
            </ul>
        </div>
        <!--pagetion-->
        <div class="pagetion">
        {$page}

        </div>
    </div>
</div>
<!--end mian-->
<!--footer-->

<!--end  footer-->
<!--top-->
<include file="Public:right"/>
<!--end  top-->
</block>

<block name="otherjs">
<script>
    $(function(){
        $('.b-list li:gt(8)').hide();
		var li_length = $('.b-list li').length;
		if(li_length<10){
		  $('a.more').hide();
		}
		
        $('.more').click(function(){
            if($(this).hasClass('on')){
                $('.b-list li:gt(8)').hide();
                $(this).html('更多');
            }else {
                $('.b-list li:gt(8)').show();
                $(this).html('收起');
            }
            $(this).toggleClass('on')
        });
    })
	
	$(".price_sub").click(function () {
		             
                   var priceMin = $('#priceMin').val()
				   var priceMax = $('#priceMax').val()
				   if(priceMin==''){
				     priceMin=0
				    }
				   if(priceMax==''){
				   priceMax=1000
				   }
				   priceMin =  parseInt(priceMin);
				   priceMax = parseInt(priceMax);
				   if(priceMin>priceMax){
				    priceMax2 = priceMin
					priceMin2 = priceMax
					priceMin = priceMin2
					priceMax = priceMax2
				    }
					
		 var url = "{$current_url}";
		     url = url.replace(/.html/, "/price/"+priceMin+"-"+priceMax+".html"); 
	         window.location.href=url
  })

</script>
</block>
